package Greed;
//最长回文串
public class LongestPalindrome { public int longestPalindrome(String s) {
    int[] hash=new int[126];
    char[] c=s.toCharArray();
    for (int i = 0; i < s.length(); i++) {
        hash[c[i]]++;
    }
    int ret=0;
    for (int i = 0; i < hash.length; i++) {
        ret+=hash[i]/2*2;
    }
    if(ret<s.length()){
        ret++;
    }
    return ret;
}

}
